package com.csh.szhm.utils;


import com.csh.szhm.SzhmApplication;

import android.content.Context;
import android.util.Log;
import android.widget.Toast;

public class DebugUntil {

	public static boolean mFlagLogDebug = false;

	private static final String Tag = "RG";

	private Toast mToast;

	public static DebugUntil mDebugUntil;

	public void toastStr(String str, Context cox) {
		if (mToast == null) {
			mToast = Toast.makeText(cox, str, 1000);
			mToast.show();
		} else {
			mToast.setText(str);
			mToast.show();
		}
	}

	public void toastStr(String str) {
		if (mToast == null) {
			mToast = Toast
					.makeText(SzhmApplication.getInstance(), str, 1000);
			mToast.show();
		} else {
			mToast.setText(str);
			mToast.show();
		}
	}

	public static void logDebug(String str) {
		if (mFlagLogDebug) {
			Log.e(Tag, str);
		}
	}

	public static DebugUntil createInstance() {
		if (mDebugUntil == null) {
			mDebugUntil = new DebugUntil();
			return mDebugUntil;
		} else {
			return mDebugUntil;
		}
	}

	public static void SystemPrintOut(String tag, String str) {
		if (mFlagLogDebug) {
			if (mDebugUntil == null) {
				System.out.printf(tag + "------>>>>>>" + str);
			}
		} else {
			return;
		}
	}

	private DebugUntil() {
	}
}
